package com.shiwaixiangcun.customer.module.intelligent

import android.os.Bundle
import com.shiwaixiangcun.customer.R
import com.shiwaixiangcun.customer.base.BaseActivity
import kotlinx.android.synthetic.main.activity_camera_start.*
import kotlinx.android.synthetic.main.top_bar_white.*


/**
 * Camera配置 用户提示界面
 */
class CameraStartActivity : BaseActivity() {


    var cameraId: String? = null
    var cameraName: String? = null
    var wifiName: String? = null
    var wifiPwd: String? = null
    var cameraRC: String? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_camera_start)
        initBundleData()
        initViewAndEvent()
    }

    private fun initBundleData() {
        val extras = intent.extras
        cameraId = extras.getString("camera_id")
        cameraName = extras.getString("camera_name")
        wifiName = extras.getString("wifi_name")
        wifiPwd = extras.getString("wifi_pwd")
        cameraRC = extras.getString("camera_rc")
    }

    private fun initViewAndEvent() {
        tv_page_name.text = "摄像机开机"
        back_left.setOnClickListener { finish() }
        btn_add_device.setOnClickListener {
            val bundle = Bundle()
            bundle.putString("camera_id", cameraId)
            bundle.putString("camera_name", cameraName)
            bundle.putString("wifi_name", wifiName)
            bundle.putString("wifi_pwd", wifiPwd)
            bundle.putString("camera_rc", cameraRC)
            readyGoThenKill(ConfigCameraActivity::class.java, bundle)
        }
    }


}
